
--存量定时数据迁移
create sequence seq_DB_SCHEDULE_TASK_id
minvalue 100
maxvalue 99999999
start with 100
increment by 1
cache 20;

insert into DB_SCHEDULE_TASK(id,task_id,task_name,batch_no,bean_class, partition_count,priority,status,cron_expression,next_fire_time,use_white_black_list)
(
      select seq_DB_SCHEDULE_TASK.Nextval,seq_DB_SCHEDULE_TASK_id.Nextval,a.description,CONCAT('N',to_char(systimestamp,'yyyymmddhh24miss')),c.job_class_name,
      1,4,'N',b.cron_expression,
      to_date(to_char(a.next_fire_time/(1000*60*60*24)+to_date('1970-01-01 08:00:00','yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss'),'N'

       from qrtz_triggers a, qrtz_cron_triggers b,qrtz_job_details c
       where a.trigger_name = b.trigger_name and b.trigger_name = c.job_name
);

drop sequence seq_DB_SCHEDULE_TASK_id;

update db_schedule_task t set t.bean_class = replace(t.bean_class,substr(t.bean_class,1,instr(t.bean_class,'.',-1)),'com.fintech.modules.wmsystem.batch.job.')
where  1=1;
--更新ExcuteAccountNotZeroJob子线程数量为10（每个批次处理的数据为1000）
update db_schedule_task t set t.partition_count = '10' where t.bean_class like '%ExcuteAccountNotZeroJob%';
--更新ExcuteQueryInvestMatchFlagJob子线程数量为4（每个批次处理的数据为500）
update db_schedule_task t set t.partition_count = '4' where t.bean_class like '%ExcuteQueryInvestMatchFlagJob%';
--更新AutoDealTaskJobSMS 子线程为10 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '10' where t.bean_class like '%AutoDealTaskJobSMS%';
--更新CreditorTransferAutoCalculateTaskJob 子线程为10 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '10' where t.bean_class like '%CreditorTransferAutoCalculateTaskJob%';
--更新 AutoDealTaskJobIEC 子线程为4 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '4' where t.bean_class like '%AutoDealTaskJobIEC%';
--更新 AutoDealTaskJobICM 子线程为4 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '4' where t.bean_class like '%AutoDealTaskJobICM%';
--更新 AutoDealTaskJobQQPR 子线程为4 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '4' where t.bean_class like '%AutoDealTaskJobQQPR%';
--更新 AutoDealTaskJobEPR 子线程为4 每批次处理的数据为100
update db_schedule_task t set t.partition_count = '4' where t.bean_class like '%AutoDealTaskJobEPR%';




